import request from '@/utils/request'

export function getReportInfo(id) {
  return request({
    url: '/report/common/getReportInfoByCommon/' + id,
    method: 'get'
  })
}

export function getMyReportList(userId, pageNum, pageSize) {
  return request({
    url: '/report/common/getMyReport/' + userId,
    method: 'get',
    params: { pageNum, pageSize }
  })
}

export function updateReport(report) {
  return request({
    url: '/report/common/update',
    method: 'put',
    data: report
  })
}

export function clientReport(reportName, reportId) {
  return request({
    url: '/report/common/clientReportList',
    method: 'get',
    params: { reportName, reportId }
  })
}

export function reportById(id) {
  return request({
    url: '/report/common/getById/' + id,
    method: 'get'
  })
}

export function getAllReportList(pageNum, pageSize) {
  return request({
    url: '/report/common/page',
    method: 'get',
    params: { pageNum, pageSize }
  })
}

export function searchAllReportList(pageNum, pageSize, searchVo) {
  return request({
    url: '/report/common/allReportSearch',
    method: 'post',
    data: searchVo,
    params: { pageNum, pageSize }
  })
}

export function getReportStatusById(id) {
  return request({
    url: '/flow/audit/getReportLeafStatus/' + id,
    method: 'get'
  })
}

export function archivesRoomList(pageNum, pageSize) {
  return request({
    url: '/report/archives/page/' + pageNum + '/' + pageSize,
    method: 'get'
  })
}

export function myReportListSearch(userId, pageNum, pageSize, searchObj) {
  return request({
    url: '/report/common/myReportSearch',
    method: 'post',
    params: { userId, pageNum, pageSize },
    data: searchObj
  })
}

export function getReportObjectiveNoPage() {
  return request({
    url: '/report/objective/noPage',
    method: 'get'
  })
}

export function getReportProjectNoPage() {
  return request({
    url: '/report/project/noPage',
    method: 'get'
  })
}

export function noPageAreaList() {
  return request({
    url: '/report/project/noPageArea',
    method: 'get'
  })
}
export function noPagePrefectureLeveLciTies() {
  return request({
    url: '/report/project/noPagePrefectureLeveLciTies',
    method: 'get'
  })
}

export function preparatoryToFormal(reportId, userId) {
  return request({
    url: '/report/common/preparatoryToFormal',
    method: 'put',
    params: { reportId, userId }
  })
}

export function downloadMode() {
  return request({
    url: '/report/common/downloadMode',
    method: 'get',
    responseType: 'blob'
  })
}

export function archivesSearchList() {
  return request({
    url: '/report/archives/searchFormList',
    method: 'get'
  })
}

export function archivesSearchPage(searchObj, pageNum, pageSize) {
  return request({
    url: '/report/archives/searchForm',
    method: 'post',
    params: { pageNum, pageSize },
    data: searchObj
  })
}

export function downloadStatistics(searchObj, userId) {
  return request({
    url: '/report/common/download',
    method: 'post',
    params: { userId },
    data: searchObj,
    responseType: 'blob'
  })
}

export function downloadStatisticsBusiness(searchObj, userId) {
  return request({
    url: '/report/common/downloadBusiness',
    method: 'post',
    params: { userId },
    data: searchObj,
    responseType: 'blob'
  })
}
